{% block sw_settings_rule_add_assignment_modal %}
<sw-modal
    class="sw-settings-rule-add-assignment-modal"
    :title="$tc(entityContext.label)"
    :variant="modalSize"
    @modal-close="onCloseAddModal"
>

    {% block sw_settings_rule_add_assignment_modal_category_tree %}
    <sw-settings-rule-category-tree
        v-if="entityContext.entityName === 'category'"
        :rule="rule"
        :association="entityContext.addContext.association"
        :categories-collection="entities"
        :hide-headline="true"
        :hide-search="true"
        placeholder="Add categories"
        @on-selection="onSelect"
    />
    {% endblock %}

    {% block sw_settings_rule_add_assignment_modal_listing %}
    <sw-settings-rule-add-assignment-listing
        v-else
        class="sw-settings-rule-detail-assignments__entity-listing"
        :entity-context="entityContext"
        :rule-id="rule.id"
        @select-item="onSelect"
    />
    {% endblock %}

    {% block sw_settings_rule_add_assignment_modal_footer %}
    <template #modal-footer>

        {% block sw_settings_rule_add_assignment_modal_cancel %}
        <mt-button
            class="sw-settings-rule-add-assignment-modal__cancel-button"
            size="small"
            variant="secondary"
            @click="onCloseAddModal"
        >
            {{ $tc('global.default.cancel') }}
        </mt-button>
        {% endblock %}

        {% block sw_settings_rule_add_assignment_modal_confirm %}
        <mt-button
            class="sw-settings-rule-add-assignment-modal__confirm-button"
            size="small"
            variant="primary"
            @click="onAdd"
        >
            {{ $tc('global.default.add') }}
        </mt-button>
        {% endblock %}
    </template>
    {% endblock %}
</sw-modal>
{% endblock %}
